package com.example.boot0601.mapper;

import com.example.boot0601.entity.Pet;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PetMapper {
    @Insert("insert into pet values(null,#{type},#{num},#{breed})")
    void insert(Pet pet);
@Select("select id,type,num,breed from pet")
    List<Pet> select();
@Delete("delete from pet where id=#{id}")
    void delete(int id);
    @Select("select id,type,num,breed from pet where id=#{id}")
    Pet selectById(int id);
@Update("update pet set type=#{type},num=#{num},breed=#{breed} where id=#{id}")
    void update(Pet pet);
}
